<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">权限管理&nbsp;-&nbsp;分区管理</li>
    </ol>
    
    <div class="ms-content-layout has-operation">

      <table class="table table-hover ms-table">
        <thead>
          <tr>
            <th>序号</th>
            <th>代码</th>
            <th>名称</th>
            <th class="text-center">操作</th>
          </tr>
        </thead>
        <tbody>
          <c:forEach var="district" items="${districts}" varStatus="status">
            <tr>
              <td>${status.index+1}</td>
              <td>${district.code}</td>
              <td>${district.name}</td>
              <td class="text-center">
                <a href="${ctx.host}/districts/${district.id}/edit" data-target="#edit" data-toggle="modal">编辑</a>
              </td>
            </tr>
          </c:forEach>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="8" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="${ctx.host}/districts" />
                      <jsp:param name="queryString" value="${queryString}"/>
                </jsp:include>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>

    </div>
  </div> 

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/authority/district-list.js" />
  <script type="text/javascript">
      require([ 'page/authority/district-list' ], function ( page ) {
        page.init();
      })
  </script>
</body>
</html>